package dongshi.daddy.springioc.three.three_five.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component(value = "databaseProperties")
@ConfigurationProperties("database")
public class DatabaseProperties {
//    @Value("${database.driverName}")
    private String driverName = null;

//    @Value("${database.url}")
    private String url = null;

    private String username = null;

    private String password = null;

    public void setUrl(String url) {
//        System.out.println("===url: " + url);
        this.url = url;
    }

    public void setDriverName(String driverName) {
//        System.out.println("===driverName: " + driverName);
        this.driverName = driverName;
    }


//    @Value("${database.user}")
    public void setUsername(String username) {
//        System.out.println("===username: " + username);
        this.username = username;
    }

//    @Value("${database.password}")
    public void setPassword(String password) {
//        System.out.println("===password: " + password);
        this.password = password;
    }

    public String getDriverName() {
        return driverName;
    }

    public String getUrl() {
        return url;
    }

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

}
